<template>
  <div>
    <h2 v-if="error.statusCode == 404" style="text-align:center;">
      <img src="/img/notfound.png" alt="404" />
    </h2>
    <h2 v-else>500服务器错误</h2>
    <h1>{{error.message}}</h1>
    <nuxt-link to="/">返回首页</nuxt-link>
  </div>
</template>
<script>
export default {
  props: ["error"],
  mounted() {
    if (!this.$auth.$state.loggedIn) location.href = "/login";
    // console.log(this.error);
  }
};
</script>
